package net.atomarrow.bs.service;

import java.util.List;

import net.atomarrow.bean.Pager;
import net.atomarrow.bs.domain.TbStudent_T;
import net.atomarrow.db.parser.Conditions;
import net.atomarrow.sy.base.BaseService;
import net.atomarrow.sy.util.DomainControl;

public class StudentService extends BaseService {

	@Override
	protected String getDomainName() {
		return DomainControl.INSTANCE.getDomainName(TbStudent_T.class);
	}

	public void addStudent(TbStudent_T student) {
		add(student);
	}

	public List<TbStudent_T> listStudents() {
		return getList(getConditions());
	}
	public List<TbStudent_T> listStudents2() {
		return getList(new Conditions(TbStudent_T.class));
	}

	public List<TbStudent_T> listStudentsByPage(){
		Pager pager =new Pager();
		pager.setPageSize(2);
		Conditions conditions = getConditions();
		conditions.putDESC("id");
		return getListByPage(conditions, pager);
	}
}
